package com.lamda.zhekou.manager;


import com.lamda.zhekou.exception.ZheKouException;
import com.lamda.zhekou.model.User;
import com.lamda.zhekou.vo.UserVpsSelectVo;

import java.util.List;

/**
 * Created by MJiao on 15/8/13.
 */
public interface UserManager {

    /**
     * 注册
     * @param user
     * @throws ZheKouException
     */
    void register(User user) throws ZheKouException;

    /**
     * 登陆
     * @param username
     * @param password
     */
    User login(String username, String password) throws ZheKouException;

    /**
     * 分页查询
     * @param pageNo
     * @param pageSize
     * @param asc  是否为升序查询
     * @return
     */
    PageModel<User> paging(int pageNo, int pageSize, boolean asc);

    List<UserVpsSelectVo> getUsersByFyEmailFilter(String keyWord);

    User getUsersByFyEmail(String userEmail);

    User findUserById(Long userId);

    List<User> getAllAdmins();

    void cancelUserAdmin(Long userId) throws ZheKouException;
    void setUserToAdmin(Long userId) throws ZheKouException;

    void modifyPassword(Long userId, String oldPasswrd, String password, String confirmPassword)throws ZheKouException;

    List<User> findAllCommonUser();

}
